//SamXIAO
#include <bits/stdc++.h>
using namespace std;
#define PI 3.1415926
#define   SQUARE(x) ((x)*(x))
//double SQUARE(double x) { return x*x;}

char f[10086];

void w1()
{
	int a, b, c,  n, L, m, ans = 0;
	scanf("%d%d", &n, &m);
	for(int i=0; i<n; i++){
		//scanf("%d", &f[i]);
  }
  memset(f, 1, sizeof(f));
	for(int i=1; i<=m; i++){
		for(int j=1; j<=n; j++){
			if(0 == j % i) f[j] = !f[j];
		}
	}
	for(int j=1; j<=n; j++) if(!f[j]) ans++;
	int cnt=0;
	for(int j=1; j<=n; j++) if(!f[j]) {
		cnt++;
		printf("%d%s", j, cnt == ans ? "" : ",");
	}
}

int main()
{
	w1();
  return 0;
}
